package com.qdxwx.common.constants;


import com.qdxwx.common.utils.PropertyUtils;

import java.util.Properties;

/**
 * Qdx NetSchool Platform
 * @author ZhiYong
 * @updateTime 2022/5/25
 * @description
 */
public class CacheConstants {

	private static final Properties cacheConfig = PropertyUtils.getInstance("cache-redis");
	public static final String NAME_SPACE = cacheConfig.getProperty("cache.space_name");
	public static final String CACHE_DICT_PRE = NAME_SPACE + ":dict:";
	public static final String ADVERT_LIST = NAME_SPACE + ":advert:list";

	public static final String CHANNEL_MENUS = NAME_SPACE + ":channel:menus:";

	public static final String MOBILE_SMS_PRE = NAME_SPACE + ":mobile:code:";

	public static final int RECOMMEND_COURSE_TIME = Integer.parseInt(cacheConfig.getProperty("cache.recommend_course_time"));

	public static final int BANNER_IMAGES_TIME = Integer.parseInt(cacheConfig.getProperty("cache.banner_images_time"));
	public static final String WEBSITE_PROFILE_PREFIX = NAME_SPACE + ":website:profile:";
	public static final int WEBSITE_PROFILE_TIME = Integer.parseInt(cacheConfig.getProperty("cache.website_profile_time"));
	public static final String WEBSITE_NAVIGATE = NAME_SPACE + ":website:navigate";
	public static final int WEBSITE_NAVIGATE_TIME = Integer.parseInt(cacheConfig.getProperty("cache.website_navigate_time"));

	//前台登录用户ehcache前缀
	public static final String USER_CODE_PREFIX = NAME_SPACE + ":user:code:";

	public static final String USER_LOGIN_COOKIE_NAME = NAME_SPACE + "_user_token";
	public static final int USER_LOGIN_COOKIE_DAYS = Integer.parseInt(cacheConfig.getProperty("cache.cookie_days"));//前台登录用户缓存6小时

	//首页缓存前缀
	public static final String INDEX_PREFIX = NAME_SPACE + ":index:";
	//前台首页 网校专家 缓存
	public static final String INDEX_TEACHER_RECOMMEND = NAME_SPACE + ":index:teacher:recommend";
	//直播 展示互动 K值 缓存
	public static final String INDEX_LIVE_GENSEEK = NAME_SPACE + ":index:live:genseek";
	//直播首页推荐
	public static final String INDEX_LIVE_RECOMMEND_PREFIX = NAME_SPACE + ":index:live:recommend:";
	//文章  好文推荐 缓存
	public static final String ARTICLE_GOOD_RECOMMEND = NAME_SPACE + ":article:recommend:good";

	public static final String COURSE_LEARNED_PREFIX = NAME_SPACE + ":course:learned:";
	//网站统计
	public static final String WEB_STATISTICS_PREFIX = NAME_SPACE + ":web:statistics:";
	//缓存1小时
	public static final int WEB_STATISTICS_TIME = Integer.parseInt(cacheConfig.getProperty("cache.web_statistics_time"));
	//帮助页面左侧菜单
	public static final String HELP_CENTER = NAME_SPACE + ":help:center";
	public static final int HELP_CENTER_TIME = Integer.parseInt(cacheConfig.getProperty("cache.help_center_time"));//缓存1小时;

	public static String ALIPAY_IS_OPEN = "ON";//启用支付宝支付
	public static String WXPAY_IS_OPEN = "ON";//启用微信支付
	public static String ACCOUNT_IS_OPEN = "ON";//启用账户支付
	public static String COUPON_IS_OPEN = "ON";//启用优惠券
	public static String WEIXIN_LOGIN_IS_OPEN = "ON";//启用微信登录
}